package java101;

public class FibPrime {

    static boolean isPrime(int n)  
       {  
          if (n%2 == 0)   
             return n == 2;   
          for (int i = 3; i <= Math.sqrt(n); i += 2)  
             if (n%i == 0)   
                return false;  
          return true;
       }
    
    public static void main (String[] args) 
       {  

    	int aF = 1;
    	int bF = 1;
    	int cF;
    	
    	do {
    		cF = aF + bF;
    		
       	  if (isPrime(cF)) { 
                System.out.println(cF);
       	  }
                aF = bF;
                bF = cF;    		
    	}while(cF < 10000);
       }
}
